require "import";
import "android.content.Context"
import "android.media.AudioManager"
import "com.androlua.*"

local audioManager=service.getSystemService(this.AUDIO_SERVICE)

local speakerMode= audioManager.isMicrophoneMute()

if speakerMode == true
audioManager.setMicrophoneMute(false)
this.speak(" microphone unmuted")
return true
elseif speakerMode == false
audioManager.setMicrophoneMute(true)
this.speak(" microphone muted")
return true
end